<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                template="/templates/ui.xhtml">
    <ui:define name="head">
        <link type="text/css" href="#{request.contextPath}/UI/epss/epss.css" rel="stylesheet"/>
        <script type="text/javascript" src="#{request.contextPath}/UI/support/pub.js"/>
        <script type="text/javascript" language="javascript">
            document.onkeydown = function TabReplace() {
                if (event.keyCode == 13) {
                    if (event.srcElement.tagName != 'BUTTON')
                        event.keyCode = 9;
                    else
                        event.srcElement.click();
                }
            }
        </script>
    </ui:define>
    <ui:define name="content">
        <h:form id="form">
            <p:growl id="msgs" showDetail="false"/>
            <h:panelGrid id="pgCondition" widgetVar="wvItemHieRelap" columns="8">
                <h:outputLabel for="noItemHieRelap" value="编号:" />
                <h:inputText id="noItemHieRelap"
                             value="#{cttDSubMStlAction.rowCttDSubMStl.subctt_StrNo}"
                             style="background-color:gainsboro"
                             readonly="true">
                </h:inputText>
                <h:outputLabel for="name" value="名称:" />
                <h:inputText id="name" value="#{cttDSubMStlAction.rowCttDSubMStl.subctt_Name}"
                             style="background-color:gainsboro"
                             readonly="true"/>
                <h:outputLabel for="note" value="备注内容:" />
                <h:inputText id="note" value="#{cttDSubMStlAction.rowCttDSubMStl.subctt_Note}"
                                   style="background-color:gainsboro"
                                   readonly="true"/>
                <h:outputLabel for="unitItemInfo" value="单位:"/>
                <h:inputText id="unitItemInfo"
                             value="#{cttDSubMStlAction.rowCttDSubMStl.subctt_Unit}"
                             style="background-color:gainsboro"
                             readonly="true"/>
                <h:outputLabel for="contractQuantityItemInfo" value="合同数量:"/>
                <h:inputText id="contractQuantityItemInfo"
                             value="#{cttDSubMStlAction.rowCttDSubMStl.subctt_ContractQuantity}"
                             style="background-color:gainsboro;text-align:right;"
                             readonly="true">
                    <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                </h:inputText>
                <h:outputLabel for="engMMng_BeginToCurrentPeriodMQty" value="开累材料量:"/>
                <h:inputText id="engMMng_BeginToCurrentPeriodMQty"
                             value="#{cttDSubMStlAction.rowCttDSubMStl.engMMng_BeginToCurrentPeriodMQty}"
                             style="background-color:gainsboro;text-align:right;"
                             readonly="true">
                    <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                </h:inputText>
               <h:outputLabel for="engMMng_CurrentPeriodMQty" value="本期材料量:"/>
                <h:inputText id="engMMng_CurrentPeriodMQty"
                             value="#{cttDSubMStlAction.rowCttDSubMStl.engMMng_CurrentPeriodMQty}"
                             style="text-align:right;float:left">
                    <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                    <p:ajax event="blur" update="msgs,engMMng_BeginToCurrentPeriodMQty"
                            listener="#{cttDSubMStlAction.blurEngMMng_CurrentPeriodMQty('blur')}"/>
                </h:inputText>
                <h:outputLabel for="contractAmountItemInfo" value="合同金额:" rendered="false"/>
                <h:inputText id="contractAmountItemInfo"
                             value="#{cttDSubMStlAction.rowCttDSubMStl.subctt_ContractAmount}"
                             style="background-color:gainsboro;"
                             rendered="false">
                    <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                </h:inputText>
                <h:outputLabel for="signPartAPriceItemInfo" value="其中：甲供材单价:" rendered="false"/>
                <h:inputText id="signPartAPriceItemInfo"
                             value="#{cttDSubMStlAction.rowCttDSubMStl.subctt_SignPartAPrice}"
                             style="background-color:gainsboro"
                             rendered="false">
                    <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                </h:inputText>
                <h:outputLabel for="originFlagItemInfo" value="数据来源:" />
                <h:inputText id="originFlagItemInfo"
                             value="#{commonAction.originFlagListValueOfAlias(
	                                             cttDSubMStlAction.rowCttDSubMStl.engMMng_OriginFlag)}"
                             style="background-color:gainsboro"
                             readonly="true"/>
                <h:outputLabel for="createdByItemInfo" value="创建人:" />
                <h:inputText id="createdByItemInfo"
                             value="#{cttDSubMStlAction.rowCttDSubMStl.engMMng_CreatedByName}"
                             style="background-color:gainsboro"
                             readonly="true"/>
                <h:outputLabel for="createdDateItemInfo" value="创建时间:" />
                <h:inputText id="createdDateItemInfo"
                             value="#{cttDSubMStlAction.rowCttDSubMStl.engMMng_CreatedDate}"
                             style="background-color:gainsboro"
                             readonly="true"/>
                <h:outputLabel for="lastUpdByItemInfo" value="修改人:" />
                <h:inputText id="lastUpdByItemInfo"
                             value="#{cttDSubMStlAction.rowCttDSubMStl.engMMng_LastUpdByName}"
                             style="background-color:gainsboro"
                             readonly="true"/>
                <h:outputLabel for="lastUpdDateItemInfo" value="修改时间:" />
                <h:inputText id="lastUpdDateItemInfo"
                             value="#{cttDSubMStlAction.rowCttDSubMStl.engMMng_LastUpdDate}"
                             style="background-color:gainsboro"
                             readonly="true"/>
                <h:outputLabel for="modificationNumItemInfo" value="修改次数:" />
                <h:inputText id="modificationNumItemInfo"
                             value="#{cttDSubMStlAction.rowCttDSubMStl.engMMng_ModificationNum}"
                             style="background-color:gainsboro;text-align:right;"
                             readonly="true">
                    <f:convertNumber type="number" pattern="#,###,###,###,##0"/>
                </h:inputText>
            </h:panelGrid>
            <h:panelGrid id="pgOperBtn" columns="3" rendered='#{cttDSubMStlAction.strMngNotFinishFlag}'>
                <p:commandButton id="submitBtn"
                                 value="#{cttDSubMStlAction.strSubmitType eq 'Add'?'提交（增加）':
                                               cttDSubMStlAction.strSubmitType eq 'Upd'?'提交（更新）':
                                               cttDSubMStlAction.strSubmitType eq 'Del'?'提交（删除）':'提交'}"
                                 action="#{cttDSubMStlAction.submitThisRecordAction}"
                                 update="pgCondition,ptt,msgs,pgOperBtn"
                                 rendered="#{cttDSubMStlAction.rowSelectedFlag}">
                </p:commandButton>
                <p:commandButton id="resetBtn" value="重置"
                                 action="#{cttDSubMStlAction.resetAction}"
                                 update="pgCondition,pcm,msgs,pgOperBtn"
                                 rendered="#{cttDSubMStlAction.rowSelectedFlag}">
                </p:commandButton>
                <p:ajaxStatus style="width:16px;height:16px;">
                    <f:facet name="start">
                        <h:graphicImage value="/images/ajaxloading.gif"/>
                    </f:facet>
                    <f:facet name="complete">
                        <h:outputText value=""/>
                    </f:facet>
                </p:ajaxStatus>
            </h:panelGrid>
            <p:contextMenu for="ptt" id="pcm" rendered='#{cttDSubMStlAction.strMngNotFinishFlag}'>
                <p:menuitem value="更新" icon="ui-icon-arrowrefresh-1-w"
                            actionListener="#{cttDSubMStlAction.selectRecordAction('Upd')}"
                            update="pgCondition,msgs,ptt,pgOperBtn">
                </p:menuitem>
                <p:menuitem value="删除" icon="ui-icon-close"
                            actionListener="#{cttDSubMStlAction.selectRecordAction('Del')}"
                            update="pgCondition,msgs,ptt,pgOperBtn">
                </p:menuitem>
            </p:contextMenu>
            <p:dataTable id="ptt" style="width:100%;"
                         value="#{cttDSubMStlAction.rowCttDSubMStlList}"
                         var="record"
                         rowKey="#{record.subctt_Pkid}"
                         selection="#{cttDSubMStlAction.rowCttDSubMStlSelected}"
                         selectionMode="single"
                         paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} 
			            {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                         paginator="true"
                         paginatorPosition="bottom"
                         rows="15"
                         rowsPerPageTemplate="500,200,90,45,30,15"
                         rowIndexVar="row"
                         emptyMessage="数据记录为空..."
                         rowStyleClass="#{record.subctt_SignPartAPrice eq 0? 'rowDoneStyle':record.subctt_SignPartAPrice eq null? 'rowDoneStyle':null}"
                         scrollable="true"
                         scrollHeight="410">
                <p:column style="width:30px" headerText="序号" >
                    <h:outputText value="#{row + 1}"/>
                </p:column>
                <p:column style="width:100px" headerText="编号">
                    <h:outputText value="#{record.subctt_StrNo}" escape="false"/>
                </p:column>
                <p:column style="width:200px" headerText="名称">
                    <h:outputText value="#{record.subctt_Name}" />
                </p:column>
                <p:column style="width:30px" headerText="单位">
                    <h:outputText value="#{record.subctt_Unit}" style="text-align:right"/>
                </p:column>
                <p:column style="width:80px" headerText="合同单价">
                    <h:outputText value="#{record.subctt_ContractUnitPrice}" style="float: right" >
                        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                    </h:outputText>
                </p:column>
                <p:column style="width:80px" headerText="合同数量">
                    <h:outputText value="#{record.subctt_ContractQuantity}" style="float: right">
                        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                    </h:outputText>
                </p:column>
                <p:column style="width:80px" headerText="合同金额">
                    <h:outputText value="#{record.subctt_ContractAmount}" style="float: right">
                        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                    </h:outputText>
                </p:column>
                <p:column style="width:80px" headerText="甲供材单价">
                    <h:outputText value="#{record.subctt_SignPartAPrice}" style="float: right">
                        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                    </h:outputText>
                </p:column>
                <p:column style="width:100px" headerText="开累材料量">
                    <h:outputText value="#{record.engMMng_BeginToCurrentPeriodMQty}" style="float: right">
                        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                    </h:outputText>
                </p:column>
                <p:column style="width:100px" headerText="当期材料量">
                    <h:outputText value="#{record.engMMng_CurrentPeriodMQty}" style="float: right">
                        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                    </h:outputText>
                </p:column>
                <p:column style="width:100px" headerText="备注内容">
                    <h:outputText value="#{record.subctt_Note}" />
                </p:column>
            </p:dataTable>
        </h:form>
    </ui:define>
</ui:composition>